1. Technical Field
The present disclosure relates to system software and more specifically to reducing access time for data in file systems when seek requests are received ahead of access requests.
2. Related Art
File systems enable data to be stored and retrieved from a storage device in the form of files. As is well known, a file represents a collection of data that is identified by a corresponding file name. Files can be grouped into one or more folders/directories which are generally organized in the form of a hierarchy/tree. As such, each file is uniquely identified by its file name and its location (termed “path”) in the hierarchy with respect to a root directory. Examples of files systems are NTFS (New Technology File System) for Windows operating system, EXT2 (second extended file system) and EXT3 (third extended file system) for Linux/Unix family of operating systems, etc.
Data forming a file is typically stored in the form of one or more blocks on the storage device, with the blocks being contiguous or scattered in non-contiguous blocks of the storage device. File systems typically maintain data structures that indicate the blocks that form each file along with other “metadata” related to each file. The metadata may include information such as the name of the file, the path of the file, date of creation, date of modification, access control, etc. File systems may also maintain data structures that specify the details of the folder/directory hierarchy.
Accessing data (from an application) in a file entails sending one or more requests to the file system. In one approach, each access to data is performed by first sending a seek request to an operating system providing access to the file system, followed by an access request. The seek request indicates information such as the name and/or path of the file, and the absolute/relative location of the data within the file (typically indicated as the number of bytes/words from the start of the file which is assumed to be 0) sought to be accessed. On receiving the seek request, the operating system stores the corresponding information in a memory.
The following access request indicates the name/path of the file, the operation (read/write) to be performed on the data indicated by the seek request, the amount of data (as number of bytes/words) to be read/written (retrieved/stored), and also the new data to be written (stored) to the file. Accordingly, on receiving the access request, the operating system identifies a block on the storage device based on the name/path of the file, the location within the file (stored in the memory based on the seek request) and the data structures maintained in the file system. The operating system then performs the specified read/write operation at the identified block.
It is generally desirable that the access time (from receiving the access request to sending a response indicating the completion of the operation specified in the access request) for data in file systems be reduced, in particular when access to the data in the file system is performed by seek requests received ahead of access requests.
In the drawings, like reference numbers generally indicate identical, functionally similar, and/or structurally similar elements. The drawing in which an element first appears is indicated by the leftmost digit(s) in the corresponding reference number.